<!DOCTYPE HTML>
<html>
<head>
<title>DNS latency plugin API</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../boomerang-docs.css">
</head>
<body>
<span style="float:right;"><a href="../">All Docs</a> | <a href="index.html">Index</a></span>
<h1>DNS latency plugin API</h1>
<p>
<strong>Note:</strong> The DNS plugin hasn't been tested.  Your help in testing it is appreciated.
</p>
<p>
The DNS plugin measures the latency of DNS lookups from the user's browser to your server.
The DNS API is encapsulated within the <code>BOOMR.plugins.DNS</code> namespace.
</p>

<p>
<strong>Note</strong> that the DNS plugin requires some amount of server-side set up.  See
<a href="../howtos/howto-8.html">Howto #8</a> for details on how to set this up.
</p>

<h2 id="methods">Methods</h2>

<dl class="api">

<dt>init(oConfig)</dt>
<dd>
<p>
Called by the <a href="BOOMR.html#init">BOOMR.init()</a> method to configure the DNS
plugin.  There is only one configurable option:
</p>
<dl>
<dt>base_url</dt>
<dd>
<strong>[required]</strong>
The <code>base_url</code> parameter tells the DNS plugin where it can find its DNS testing
images.  This URL must contain a wildcard character which will be replaced with a random
string.  The images will be appended to this string without any other modification.  If you
have any pages served over HTTPS, then this URL should be configured to work over HTTPS as
well as HTTP.  The protocol part of the URL will be automatically changed to fit the current
document.
</dd>
</dl>
<pre>
BOOMR.init({
		<em>DNS: {                                                  </em>
		<em>            base_url: "http://*.yoursite.com/images/"   </em>
		<em>}                                                       </em>
	});
</pre>
<p>
In the above code, * will be replaced with a random string.
</p>

<h3>Returns</h3>
<p>
a reference to the <code>BOOMR.plugins.DNS</code> object, so you can chain methods.
</p>
<h3>Note</h3>
<p>
The DNS test will not run if a <code>base_url</code> is not configured.
</p>
</dd>

<dt>is_complete()</dt>
<dd>
<p>
Called by <a href="BOOMR.html#sendBeacon">BOOMR.sendBeacon()</a> to determine if the DNS plugin has
finished what it's doing or not.
</p>
<h3>Returns</h3>
<ul>
<li><code>true</code> if the plugin has completed.</li>
<li><code>false</code> if the plugin has not completed.</li>
</ul>
</dd>

</dl>

<h2 id="beacon">Beacon Parameters</h2>
<p>
This plugin adds the following parameter to the beacon:
</p>
<dl>
<dt>dns</dt>
<dd>The worst-case DNS latency from the user's browser to your DNS server.</dd>
</dl>

<p class="perma-link">
The latest code and docs is available on <a href="http://github.com/lognormal/boomerang/">github.com/lognormal/boomerang</a>
</p>

</body>
</html>
<!--
    Copyright (c) 2011, Yahoo! Inc.  All rights reserved.
    Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms.
-->
